package com.leagueoflegends.service.impl;

import com.github.pagehelper.PageHelper;
import com.leagueoflegends.bean.Champion;
import com.leagueoflegends.bean.ChampionPassive;
import com.leagueoflegends.bean.ChampionSpell;
import com.leagueoflegends.mapper.ChampionSpellManageMapper;
import com.leagueoflegends.mapper.ChampionSpellMapper;
import com.leagueoflegends.service.ChampionSpellManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ChampionSpellManageServiceImpl implements ChampionSpellManageService {
    @Autowired
    ChampionSpellManageMapper championSpellManageMapper;

    @Override
    public List<ChampionSpell> selectSpell(int championId) {
        return championSpellManageMapper.selectSpell(championId);
    }

    @Override
    public List<Champion> selectChampionSpell(int pageNum, int pageSize, int val, String find) {
        PageHelper.startPage(pageNum, pageSize);
        return championSpellManageMapper.selectChampionSpell( val, find);
    }

    @Override
    public List<Champion> selectNoHaveSpell() {
        return championSpellManageMapper.selectNoHaveSpell();
    }

    @Override
    public List<Champion> selectDeletedChampion() {
        return championSpellManageMapper.selectDeletedChampion();
    }

    @Override
    public void update(ChampionSpell spell) {
        championSpellManageMapper.update(spell);
    }

    @Override
    public void insert(ChampionSpell spell) {
        championSpellManageMapper.insert(spell);
    }

    @Override
    public void delete(Integer id) {
        championSpellManageMapper.delete(id);
    }
}
